﻿<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="true" CodeFile="Student.aspx.cs"
    Inherits="Student" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="Scriptmanager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Label runat="server" ID="lblUser" />
        <table>
            <tr>
                <td>
                    Roll No.
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtRoll" />
                </td>
            </tr>
            <tr>
                <td>
                    Name
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtName" />
                </td>
            </tr>
            <tr>
                <td>
                    Age
                </td>
                <td>
                    <asp:TextBox runat="server" ID="txtAge" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:DataList ID="dlstStateCutoffTime" runat="server" RepeatDirection="Vertical"
                        Width="100%">
                        <HeaderTemplate>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td align="right" valign="middle" style="width: 51%">
                                    <asp:Label ID="lblStateName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Name")  + ":"%>'
                                        CssClass="formLabel3"></asp:Label>
                                </td>
                                <td align="left" valign="middle" style="width: 49%">
                                    <asp:TextBox runat="server" ID="txt1" />
                                </td>
                            </tr>
                        </ItemTemplate>
                        <SeparatorTemplate>
                            <tr>
                                <td colspan="2" class="formFieldGap">
                                </td>
                            </tr>
                        </SeparatorTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:DataList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button runat="server" ID="btnSave" Text="Save" OnClick="btnSave_Click" />
                    <asp:Button runat="server" ID="btnhidden" Text="Show" Style="display: none" />
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <table width="100%">
                        <tr>
                            <td>
                                <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                    <ContentTemplate>--%>
                                <asp:GridView ID="grdStudents" runat="server" AllowPaging="True" PageSize="5" DataKeyNames="RollNo"
                                    AutoGenerateColumns="False" Width="1000px" CellPadding="4" ForeColor="#333333"
                                    GridLines="None">
                                    <AlternatingRowStyle BackColor="White" />
                                    <Columns>
                                        <%-- <asp:BoundField HeaderText="Roll No." DataField="RollNo" ItemStyle-Wrap="false">
                            </asp:BoundField>--%>
                                        <asp:TemplateField HeaderText="Roll No.">
                                            <ItemTemplate>
                                                <asp:Label ID="lblRollNo" Text='<%# Eval("RollNo")%>' runat="server" BackColor="Aqua" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="St. Age" DataField="Age" ItemStyle-Wrap="false">
                                            <ItemStyle Wrap="False"></ItemStyle>
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderText="Grade">
                                            <ItemTemplate>
                                                <asp:Label ID="lblGrade" Text='<%# GetGrade(Eval("Age"))%>' runat="server" ForeColor="Red" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="St. Name." DataField="Name" ItemStyle-Wrap="false">
                                            <ItemStyle Wrap="False"></ItemStyle>
                                        </asp:BoundField>
                                        <asp:BoundField HeaderText="Trn. Amount(Rs.)" DataField="TrnAmount" ItemStyle-Wrap="false">
                                            <ItemStyle Wrap="False"></ItemStyle>
                                        </asp:BoundField>
                                        <asp:TemplateField HeaderStyle-Wrap="false" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="35px"
                                            HeaderText="Delete">
                                            <ItemTemplate>
                                                <asp:ImageButton ID="imgDelete" runat="server" ToolTip="Delete" CommandName="Delete"
                                                    CommandArgument='<%# Eval("RollNo")%>' ImageUrl="~/images/delete.gif" />
                                                <%-- <asp:LinkButton ID="lnkBtnDelete" runat="server" Text="Delete" CommandName="Delete"
                                                            CommandArgument='<%# Eval("RollNo")%>' />--%>
                                                <%-- <asp:LinkButton ID="lnkbtnGo" runat="server" Text="Go" CommandName="Go" CommandArgument='<%# Eval("RollNo")%>' />--%>
                                            </ItemTemplate>
                                            <HeaderStyle Wrap="False"></HeaderStyle>
                                            <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                        </asp:TemplateField>
                                    </Columns>
                                    <EditRowStyle BackColor="#2461BF" />
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                    <RowStyle BackColor="#EFF3FB" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
                                </asp:GridView>
                                <%--   </ContentTemplate>
                                </asp:UpdatePanel>--%>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <cc1:ModalPopupExtender ID="mpeEdit" runat="server" BackgroundCssClass="modalBackground"
                                    CancelControlID="btnModalCanel" DropShadow="true" Drag="false" PopupControlID="pnlStudEdit"
                                    TargetControlID="btnhidden">
                                </cc1:ModalPopupExtender>
                                <asp:Panel ID="pnlStudEdit" runat="server" CssClass="modalBox2" Style="display: none;
                                    border: none; border: 1px solid #112d52; height: 250px; width: 550px" align="center">
                                    <asp:Label runat="server" ID="lblName" />
                                    <asp:Button runat="server" ID="btnModalCanel" Text="Cancel" OnClick="btnSave_Click" />
                                </asp:Panel>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
